home *** CD-ROM | disk | FTP | other *** search
/ Digital Background Bonanza / Digital Background Bonanza - Disc 2.iso / pc / Slideshow2.swf / scripts / DefineSprite_53 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-03-09  |  1.2 KB  |  62 lines

  1. function updateFrame(inc)
  2. {
  3.    newFrame = _root._currentFrame + inc;
  4.    _root.gotoAndStop(newFrame);
  5.    updateStatus();
  6.    if(_root._currentFrame == 1)
  7.    {
  8.       prevBtn.gotoAndStop(2);
  9.    }
  10.    else
  11.    {
  12.       prevBtn.gotoAndStop(1);
  13.    }
  14.    if(_root._currentFrame == _root._totalFrames)
  15.    {
  16.       nextBtn.gotoAndStop(2);
  17.    }
  18.    else
  19.    {
  20.       nextBtn.gotoAndStop(1);
  21.    }
  22. }
  23. function updateStatus()
  24. {
  25.    _root.statusField = _root._currentFrame + " of " + _root._totalFrames;
  26. }
  27. function autoplayInit()
  28. {
  29.    startTime = getTimer();
  30.    hideControls();
  31.    updateStatus();
  32. }
  33. function autoplay()
  34. {
  35.    if(autoplayStatus != 0)
  36.    {
  37.       curTime = getTimer();
  38.       elapsedTime = curTime - startTime;
  39.       indicatorFrame = int(4 / (delay / (elapsedTime / 1000)));
  40.       indicator.gotoAndStop(indicatorFrame + 1);
  41.       if(elapsedTime >= delay * 1000)
  42.       {
  43.          if(_root._currentframe == _root._totalframes)
  44.          {
  45.             _root.gotoAndStop(1);
  46.          }
  47.          else
  48.          {
  49.             _root.nextFrame();
  50.          }
  51.          autoplayInit();
  52.       }
  53.    }
  54. }
  55. function hideControls()
  56. {
  57.    nextBtn.gotoAndStop(2);
  58.    prevBtn.gotoAndStop(2);
  59. }
  60. updateFrame();
  61. autoplayStatus = 0;
  62.